package test

import (
	"fmt"
	"regexp"
)

func Test() {
	text := `Hello 世界！123 Go.`
	reg := regexp.MustCompile(`[a-z]+`)

	// FindAllString is the 'All' version of FindString; it returns a slice of all
	// successive matches of the expression, as defined by the 'All' description
	// in the package comment.
	// A return value of nil indicates no match.
	fmt.Printf("%q\n", reg.FindAllString(text, -1))
	// ["ello" "o"]


	// FindString returns a string holding the text of the leftmost match in s of the regular
	// expression. If there is no match, the return value is an empty string,
	// but it will also be empty if the regular expression successfully matches
	// an empty string. Use FindStringIndex or FindStringSubmatch if it is
	// necessary to distinguish these cases.
	fmt.Printf("%q\n", reg.FindString(text))
	// "ello"

}
